Advances in technology have proliferated computer usage. Today, computer systems have become an integral part of everyday life. As modern society becomes more dependent upon computer systems, time and resources are being spent in order to assure the continual growth in the computer industry by minimizing users' frustration and increasing users' trust in the computer system.
A common problem that has frustrated users and has undermined the trust in the computer system is application failure. An application failure may occur when memory is insufficient in a computer system. In computer processing, memory is a limited resource that typically has to be shared among the various different applications of a computer system. During processing, one or more portions of memory may be allocated to an application program. In an ideal situation, the application program may release one or more portions of memory that are not being utilized by the application program thus enabling the freed portions of memory to be available for re-allocation.
Releasing one or more portions of memory may be performed by the application program or by an automatic memory management system. An application program may provide explicit instructions to release one or more portions of memory that are not being utilized by the application program. However, the dependence upon the application program to provide the necessary instruction for memory management may be susceptible to programming errors. In an example, a programmer may forget to provide instruction for performing memory management in one section of the code. As a result, one or more portions of memory may be held even though the memory may not be utilized nor needed resulting in memory leak. A memory leak can cause poor application performance or even application failure.
Some programming languages, such as Java, have implemented automatic memory management system (e.g., garbage collection) to dynamically handle memory management. With automatic memory management system, unused portions of memory are released in order to be re-allocated by the application in the future. By implementing automatic memory management system, memory management is no longer dependent upon the skill of the programmers to assure that unused portions of memory are released in a timely manner. However, even automatic memory management systems may be unable to prevent increasing memory consumption by an application if the total amount of memory occupied by objects referenced by the application grows over time. Increasing memory consumption generally occurs due to flaws in the application logic. In an example, the application program may have failed to designate a size limit to a data structure, such as a cache. As a result, the cache may grow without limits resulting in increasing memory consumption.
Traditional tools for increasing memory consumption analysis (e.g., Wily's Leak Hunter, Mercury's Diagnostics, etc.) usually focus on detecting growing Java collection objects. In an example, memory analysis tools may track individual collection objects. If a collection object grows too fast, too large, or for a long time, the tools may report the collection object as a potential source of memory leak. With these tools, a collection object's growth may have to surpass a threshold (e.g., time, size, etc.) before the collection object is identified as a potential memory leak.
In another example of an increasing memory consumption, a Java collection A may be created. After processing has been performed, the Java collection A may have been garbage collected. However, before the Java collection A has been garbage collected, another Java collection B may have been created and the content of the previous Java collection A may have been copied into the new Java collection B. Thus, if these actions are performed repeatedly by an application, even though the previous Java collection may have been garbage collected, each time a new Java collection is created the size of the Java collection may be growing. The growth of each new Java collection may continue without restraint until an application failure/abort occurs.
The task of identifying the root causes of increasing memory consumption can be tedious and time consuming. Further, the task of identifying increasing memory consumption in a large business critical environment, such as a deployed Internet server environment, can be especially difficult. In such a critical environment, programmers generally do not have the luxury of shutting down the application program in order to identify the source of the increasing memory consumption. However, if the root cause of the increasing memory consumption is not identified, an increased demand on limited memory resources may slow down the application and ultimately cause total application failure.